import { defHttp } from '/@/common/util/axios';

enum Api {
  list = '/online/genDataTableColumn/getPage',
  save = '/online/genDataTableColumn/add',
  edit = '/online/genDataTableColumn/edit',
  deleteOne = '/online/genDataTableColumn/delete',
  updateBatch = '/online/genDataTableColumn/updateBatch',
  deleteBatch = '/online/genDataTableColumn/deleteBatch',
  importExcel = '/online/genDataTableColumn/importExcel',
  exportXls = '/online/genDataTableColumn/exportXls',
}
/**
 * 导出导入api
 * @param params
 */
export const getExportUrl = Api.exportXls;
export const getImportUrl = Api.importExcel;
/**
 * 增删改查接口
 */
export const list = (params) => defHttp.get({ url: Api.list, params });
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
export const deleteOne = (params) => defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true });
export const updateBatch = (params) => defHttp.post({ url: Api.updateBatch, params });
export const deleteBatch = (params) => defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true });

